<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>入库流水</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select.css">
	<style>
		.main-bg{
			padding-top: 0px;
		}
		.content-table-two{
			width: 1080px;
		}
		.content-table-two tbody tr td {
    		max-width: 300px;
    		min-width: 30px; 
    	}
		.content-table-two tbody tr td{
			width: 100px;
			padding-left: 12px;
			padding-right: 12px;
		}
		.content-table-two tbody tr td:first-child{
			width:30px;
		}
		.content-table-two tbody tr td:nth-child(3){
			width:200px;
		}
		.content-table-two tbody tr td:nth-child(3){
			width:100px;
		}
		.content-table-two tbody tr td:nth-child(4){
			width:60px;
		}
		.content-table-two tbody tr td:nth-child(5){
			width: 100px;
		}
		.content-table-two tbody tr td:nth-child(6){
			width:180px;
		}
		.content-btn {
		    margin:0 16px;
		}
		.export-btn {
		    float: left;
		    margin-top: 0px;
		}
	</style>
</head>
<body> 
	<div class="main-content">
		<div class="main-bg">
			<div class="content-btn bot-line">
				<a class="icon-back" href="contractEntry.html"></a><span class="title-info-a">入库流水</span>
			</div>
			<div class="content-form">
				<form id = "historyForm">
					<input type = "hidden" name = "inboundid" >
					<ul>
						<li>
							<span class="text-name">批次号：</span>
							<input type="text" name = "batch" />
						</li>
						<li>
							<span class="text-name">操作时间：</span>
							<input id="data-time" class="laydate-icon" type="text">&nbsp;-&nbsp;
							<input id="data-time1" class="laydate-icon"type="text">
						</li>
						<li><button class="btn-style-two" id = "seachHistory">搜索</button><i class="btn-operation maleft20">重置</i></li>
					</ul>
				</form>
			</div>
			<div class="content-list">
				<div class="info-list">
					<table  class="content-table-two" cellspacing="0" cellpadding="0" datatable = "true" bindClick = "seachHistory" bindForm = "historyForm" dataAction = "/contractInboundHistroy/findList">
						<tbody style = "display:none;">
							<th title = "批次号" name = "batch" type = "string"></th>
							<th title = "入库数" name = "amount" type = "string"></th>
							<th title = "维护人" name = "updateBy" type = "string"></th>
							<th title = "维护时间" name = "updateDate" type = "string"></th>
						</tbody>
					</table>
					<!-- <table class="content-table-two" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>批次号</td>
								<td>项目编号</td>
								<td>项目名称</td>
								<td>入库数量</td>
								<td>操作人</td>
								<td>操作时间</td>
								<td>操作</td>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
							<tr>
								<td>132432423</td>
								<td>132432423</td>
								<td>恒天财富稳盛5号投资基金（四期未赎回报备）</td>
								<td>20</td>
								<td>李雄</td>
								<td>2017-02-02 13:00:00</td>
								<td>
									<i class="btn-operation" onclick="addTreasury()">撤销入库</i>
								</td>
							</tr>
						</tbody>
					</table> -->
				</div>
			</div>
		</div>
		<!-- <div class="table-pages clearfix">
			<ul class="pages-list">
				<li><a href=""><</a></li>
				<li><a class="menu-active" href="">1</a></li>
				<li><a href="">2</a></li>
				<li><a href="">3</a></li>
				<li><a href="">...</a></li>
				<li><a href="">20</a></li>
				<li><a href="">></a></li>
			</ul>
		</div> -->
	</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/table.js"></script>
	<script src="lib/rili/laydate.dev.js"></script>
	<script type="text/javascript" src = "js/allProduct.js"></script>
	<script>
		$(document).ready(function (){//新增
			var eventStart = {  
			        elem: '#data-time',  
			        format: 'YYYY/MM/DD',  
			        // min: laydate.now(), 
			        max: '2099-06-16',  
			        istime: true,  
			        istoday: true,  
			        // start: laydate.now(0,"YYYY-MM-DD"),  
			        choose: function(enddatas){  
			        	/* activityStart.max = enddatas; //结束日选好后，重置开始日的最大日期  
			        	activity_end_time=enddatas; */
			        }  
			    };
			var eventEnd = {  
			        elem: '#data-time1',  
			        format: 'YYYY/MM/DD',  
			        // min: laydate.now(), 
			        max: '2099-06-16',  
			        istime: true,  
			        istoday: true,  
			        // start: laydate.now(0,"YYYY-MM-DD"),  
			        choose: function(enddatas){  
			        	/* activityStart.max = enddatas; //结束日选好后，重置开始日的最大日期  
			        	activity_end_time=enddatas; */
			        }  
			    };
			laydate(eventStart);
			laydate(eventEnd);
			var data = parent.data;
			$("input[name='inboundid']").val(data.id);
		 });

		$('.multiselect').multiselect({setMaxOptionNum:4,selectedHtmlValue:''});
		$('#single').multiselect({multiple:false,selectedHtmlValue:'待下架',setWidth: 140+'px'});
		$('#single1').multiselect({multiple:false,selectedHtmlValue:'未配置',setWidth: 140+'px'});
		function deleteTreasury(i){
			var allData = $("table").getAllData();
			parent.layer.confirm('确认撤销入库么？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				console.log(allData[i]);
				var data = new FormData();
				data.append("inboundid",allData[i].inboundid);
				data.append("amount",allData[i].amount);
				data.append("id",allData[i].id);
				data.append("batch",allData[i].batch);
				$.ajax({
			        type: 'post',
			        url:baseUrl + "/contractInboundHistroy/delete",
			        contentType: false,  
			        processData: false, 
			        async: false,
			        data:data
				}).done(function(dt){
					if(dt == 0){
						parent.layer.msg("改批合同已开始配送,不能撤销入库。");
					}
					parent.layer.closeAll();
					$("table").ECDATable();
				});
			}, function(){
				parent.layer.closeAll();
			});
		}

		function tableCallBack(my){
			my.find("thead").find("tr").find("td").eq(0).after("<td>项目名称</td><td>项目编号</td>");
			my.find("thead").find("tr").find("td").eq(5).after("<td>操作</td>");
			var $tr = my.find("tbody").eq(1).find("tr");
			var allData = $("table").getAllData();
			var data = parent.data;
			if(data){
				for(var i = 0 ; i < $tr.length ; i++){
					var html = "<td>" + data.projectname + "</td><td>" + data.projectcode + "</td>";
					$($tr[i]).find("td").eq(0).after(html);
					html = "<td><i class=\"btn-operation\" onclick=\"deleteTreasury(" + i + ")\">撤销入库</i></td>";
					$($tr[i]).find("td").eq(5).after(html);
				}
			}
		}

        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
        $('.main-content').resize(function(){
            getHeight();
        });
	</script>
</body>
</html>